﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Demo
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
            _frmSoloution = new frmSolution();
            _frmView = new frmView();
        }



        frmSolution _frmSoloution;
        frmView _frmView;


       

        private void frmMain_Load(object sender, EventArgs e)
        {
            InitilaizeLayout();
        }



        void InitilaizeLayout()
        {
            this.dockPanel1.DockLeftPortion = 250;
            this.dockPanel1.DockLeftPortion = 250;
            this._frmSoloution.Show(this.dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft);
            this._frmView.Show(this.dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.Document);
        }


        void NewProject()
        {
            //SaveFileDialog dlg = new SaveFileDialog();
            //dlg.Filter = "";
            //if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            //{
            //    return;
            //}
            _frmView.NewProject();
        }

        private void toolStripNew_Click(object sender, EventArgs e)
        {
            NewProject();
        }


        private void toolStripPan_Click(object sender, EventArgs e)
        {
            _frmView.Pan();
        }

        private void toolStripMax_Click(object sender, EventArgs e)
        {
            _frmView.ZoomToMax();
        }

        private void toolStripSelect_Click(object sender, EventArgs e)
        {
            _frmView.SelectShape();
        }

        private void toolStripLine_Click(object sender, EventArgs e)
        {
            _frmView.AddLine("LineSource");
        }

       

      

       








    }
}
